const vscode = require('vscode');
const { TransitionFolder } = require('./Constant')
const path = require('path');
const getTemplatesPath = async () => {
    let templatesPath = path.resolve(__dirname, '../transition/templates')
    const files = await vscode.workspace.findFiles(`${TransitionFolder}/**`)
    if (files.length > 0) {
        templatesPath = files[0].fsPath
        const pathArr = templatesPath.split('\\')
        templatesPath = pathArr.splice(0, pathArr.length - 1).join('\\');
    }
    return templatesPath
}

module.exports = getTemplatesPath;